-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add useGetAggregateFromServerQuery hook #106
Add useGetAggregateFromServerQuery hook #106
Conversation
To view this pull requests documentation preview, visit the following URL: react-query-firebase.invertase.dev/~106 Documentation is deployed and generated using docs.page. |
: never; | ||
}; | ||
|
||
export function useGetAggregateFromServerQuery<T extends AggregateSpec>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should change the API spec here, since the aggregates are a requirement, so:
useGetAggregateFromServerQuery(query, {
countOfDocs: count(),
totalHours: sum('hours'),
averageScore: average('score')
});
Let's keep any optional parts in the firestore key and make sure they are all optional values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the clarity here. absolutely, going to adjust here and keep all required parts at the top level and optional parts maintaining them as optional in the firestore key object
This PR adds
useGetAggregateFromServerQuery
hook